package com.jadefashion.web;

import org.apache.dubbo.common.threadpool.support.fixed.FixedThreadPool;

import java.util.concurrent.*;

public class MyTest {
    public static void main(String[] args) {
//        FixedThreadPool fixedThreadPool = new FixedThreadPool();
//        fixedThreadPool.
        ExecutorService executorService = Executors.newFixedThreadPool(2);
        Future submit = executorService.submit(new Mycallable());
        try {
            Object o = submit.get();
            System.out.println(o);
        } catch (InterruptedException e) {
            e.printStackTrace();
        } catch (ExecutionException e) {
            e.printStackTrace();
        }
        executorService.shutdown();
    }
}

class Mycallable implements Callable{
    @Override
    public String call() throws Exception {
        return "呵呵";
    }
}
